package com.sove.face.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import com.sove.face.Entity.Faces;
import com.sove.face.repository.FacesRepository;
import com.sove.face.service.FacesService;

@Service
public class FacesServiceImpl implements FacesService {

    @Autowired
    FacesRepository repository;

    @Override
    public Faces save(Faces entity) {
        return repository.save(entity);
    }

	@Override
	public int count() {
		return (int) repository.count();
	}

	@Override
	public Page<Faces> getFaces(int page, int size) {
		PageRequest pageable = PageRequest.of(page, size);
		return repository.findAll(pageable);
	}
}
